package org.greatlogic.gwtfilereaderwidget.client.xml;

import java.util.TreeMap;

public interface XMLEnums {
//--------------------------------------------------------------------------------------------------
enum EBufferState {
InUse, // the scanner is using the buffer
Loading,
NoData,
Ready
} // enum EBufferState
//--------------------------------------------------------------------------------------------------
public enum EXMLEscapeSequence {
Ampersand("amp", '&'),
Apostrophe("apos", '\''),
GreaterThan("gt", '>'),
LessThan("lt", '<'),
Quote("quot", '"');
private char   _escapeChar;
private String _escapeString;
EXMLEscapeSequence(final String escapeString, final char escapeChar) {
  _escapeString = escapeString;
  _escapeChar = escapeChar;
} // EXMLEscapeSequence()
public char getEscapeChar() {
  return _escapeChar;
} // getEscapeChar()
public String getEscapeString() {
  return _escapeString;
} // getEscapeString()
} // enum EXMLEscapeSequence
//--------------------------------------------------------------------------------------------------
public enum EXMLEventType {
Attribute(XMLStreamConstants.ATTRIBUTE),
CData(XMLStreamConstants.CDATA),
Characters(XMLStreamConstants.CHARACTERS),
Comment(XMLStreamConstants.COMMENT),
DTD(XMLStreamConstants.DTD),
EndDocument(XMLStreamConstants.END_DOCUMENT),
EndElement(XMLStreamConstants.END_ELEMENT),
EntityDeclaration(XMLStreamConstants.ENTITY_DECLARATION),
EntityReference(XMLStreamConstants.ENTITY_REFERENCE),
Namespace(XMLStreamConstants.NAMESPACE),
NotationDeclaration(XMLStreamConstants.NOTATION_DECLARATION),
ProcessingInstruction(XMLStreamConstants.PROCESSING_INSTRUCTION),
Space(XMLStreamConstants.SPACE),
StartDocument(XMLStreamConstants.START_DOCUMENT),
StartElement(XMLStreamConstants.START_ELEMENT),
Unknown(-1);
private static TreeMap<Integer, EXMLEventType> _streamEventByStreamConstantMap;
private int                                    _streamConstant;
private EXMLEventType(final int streamConstant) {
  _streamConstant = streamConstant;
} // EXMLEventType()
public int getStreamConstant() {
  return _streamConstant;
} // getStreamConstant()
public static EXMLEventType lookupUsingStreamConstant(final int streamConstant) {
  EXMLEventType result;
  if (_streamEventByStreamConstantMap == null) {
    _streamEventByStreamConstantMap = new TreeMap<Integer, XMLEnums.EXMLEventType>();
    for (EXMLEventType streamEvent : EXMLEventType.values()) {
      _streamEventByStreamConstantMap.put(streamEvent._streamConstant, streamEvent);
    }
  }
  result = _streamEventByStreamConstantMap.get(streamConstant);
  return result == null ? EXMLEventType.Unknown : result;
} // lookupUsingStreamConstant()
} // enum EXMLEventType
//--------------------------------------------------------------------------------------------------
}